#include <iostream>
#include <cstdio>

#include "StaticAnalysis/static.hpp"
#include "ParserLexer/treestruct.hpp"
#include "ParserLexer/y.tab.h"


using namespace std;


int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        cerr << "Wrong number of arguments";
    }
    else
    {
        tree* result = lexer_parser(argv[1]);
        printtree(result, 0);
        printf("Tree created\n");
        static_analysis_init();

        tree_typed* checked = new tree_typed;
        checked = static_analysis(*result, 0);
        printf("Tree checked\n");
    }
    return 1;
}
